<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加比赛</title>
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-datetimepicker.min.css" />
</head>
<body>
<div>
    <div class="btn-group col-md-6 btn-group-justified " role="group">
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-primary" onclick="javascript:location.href='{:U(\'Match/index\')}'">添加比赛</button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-default" onclick="javascript:location.href='{:U(\'Team/index\')}'">添加队伍</button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-default" onclick="javascript:location.href='{:U(\'Userinfo/index\')}'">添加队员</button>
        </div>
    </div>
        <form class="form-horizontal" method="post" id="tt" autocomplete="on">
                <div class="form-group col-md-12" style="margin-top: 50px;">
                    <label class="col-md-2 control-label">比赛名称：</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="name" name="name">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">比赛日期：</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control date-picker" id="match_date" name="match_date">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">开始时间：</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control date-picker" id="date_s" name="date_s">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">结束时间：</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control date-picker" id="date_e" name="date_e">
                    </div>
                </div>
                <!--<div class="form-group col-md-12">-->
                    <!--<label class="col-md-2 control-label">比赛时长：</label>-->
                    <!--<div class="col-md-4">-->
                        <!--<input type="text" class="form-control" id="when_long" name="when_long">-->
                    <!--</div>-->
                <!--</div>-->
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">mvp：</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="mvp" name="mvp">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">比赛类型：</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="match_type" name="match_type">
                    </div>
                </div>
            <div class="form-group col-md-12">
                <label class="col-md-4 control-label"></label>
                <div class="col-md-8">
                    <button type="button" class="btn btn-primary" id="tijiao">保存</button>
                </div>
            </div>
        </form>
</div>
</body>
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/bootstrap-datetimepicker.min.js" type="text/javascript" charset="utf-8"></script>
<script src="__PUBLIC__/js/bootstrap-datetimepicker.zh-CN.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(".date-picker").datetimepicker({
        language: 'zh-CN',
        format: 'yyyy-mm-dd hh:ii:ss',
        autoclose:true,
    });
    $("#tijiao").on('click',function(){
        var form = $("#tt");
        $.ajax({
            url:form.attr("action"),
            type:'post',
            data:form.serialize(),
            dataType: 'json',
            success:function(data){
                alert(data.info);
                location.href="{:U(\'Team/index\')}";
            }
        })
    })
</script>
</html>